package jongo;

import java.util.Date;

import org.nutz.http.Header;
import org.nutz.http.Request;
import org.nutz.http.Request.METHOD;
import org.nutz.http.Sender;
import org.nutz.json.Json;
import org.nutz.lang.Times;
import org.nutz.lang.util.NutMap;

/**
 * @author 王贵源<kerbores>
 *
 *         create at 2015年12月22日 上午9:03:34
 */
public class A {

	public static class User {

		private int id;

		private String name;

		private Date birthDay = Times.now();

		private double height;

		private Status status;

		/**
		 * @return the status
		 */
		public Status getStatus() {
			return status;
		}

		/**
		 * @param status
		 *            the status to set
		 */
		public void setStatus(Status status) {
			this.status = status;
		}

		public static enum Status {
			A, D
		}

		/**
		 * @return the id
		 */
		public int getId() {
			return id;
		}

		/**
		 * @param id
		 *            the id to set
		 */
		public void setId(int id) {
			this.id = id;
		}

		/**
		 * @return the name
		 */
		public String getName() {
			return name;
		}

		/**
		 * @param name
		 *            the name to set
		 */
		public void setName(String name) {
			this.name = name;
		}

		/**
		 * @return the birthDay
		 */
		public Date getBirthDay() {
			return birthDay;
		}

		/**
		 * @param birthDay
		 *            the birthDay to set
		 */
		public void setBirthDay(Date birthDay) {
			this.birthDay = birthDay;
		}

		/**
		 * @return the height
		 */
		public double getHeight() {
			return height;
		}

		/*
		 * (non-Javadoc)
		 * 
		 * @see java.lang.Object#toString()
		 */
		@Override
		public String toString() {
			return Json.toJson(this);
		}

		/**
		 * @param height
		 *            the height to set
		 */
		public void setHeight(double height) {
			this.height = height;
		}

	}

	public static void main(String[] args) {
		NutMap params = NutMap.NEW();
		Header header = Header.create().set("test", "重庆");
		System.err.println(Sender.create(Request.create("localhost:8080/crm/sql/test", METHOD.POST, params, header).setEnc("UTF-8")).send().getContent());
	}
}
